<!-- 按行业 -->
<template>
  <div class="table w1021">
    <div class="tableTh tableTr flex">
      <span class="tableTd w130 high">排名</span>
      <span class="tableTd w130 high">股票代码</span>
      <span class="tableTd w130 high">股票简称</span>
      <span class="tableTd w220 high">总市值（亿元）</span>
      <span class="tableTd w220 high">
        流通市值
        <br />（亿元）
      </span>
      <span class="tableTd w220 high">
        营业收入
        <br />（亿元）
      </span>
      <span class="tableTd w220 high">
        归属净利润
        <br />（百万元）
      </span>
      <span class="tableTd w220 high">
        营业收入同
        <br />比增长（％）
      </span>
      <span class="tableTd w220 high">
        归属净利润
        <br />同比增长（％）
      </span>
    </div>
    <div class="tableTr tableBody top flex" v-for="(item,index) in data" :key="index">
      <span class="orange tableTd w130">{{item.rank|filterVal}}</span>
      <span class="orange tableTd w130">{{item.stockCode|filterVal}}</span>
      <span class="orange tableTd w130">{{item.stockName|filterVal}}</span>
      <span class="orange tableTd w220">{{item.totalVal|filterVal("yi")}}</span>
      <span class="orange tableTd w220">{{item.circulationVal|filterVal("yi")}}</span>
      <span class="orange tableTd w220">{{item.operatingRevenue|filterVal("yi")}}</span>
      <span class="orange tableTd w220">{{item.npParentCompanyOwners|filterVal("bw")}}</span>
      <span class="orange tableTd w220">{{item.operatingRevenueGrowRate|filterVal("no")}}</span>
      <span class="orange tableTd w220">{{item.netProfitYoy|filterVal("no")}}</span>
    </div>
    <div class="tableNone orange w1021 top" v-if="data.length==0">暂无数据</div>
  </div>
</template>

<script>
import { numberNo, number } from "../../script/api";
export default {
  data() {
    return {};
  },
  props: ["data"],
  filters: {
    filterVal(ops, num) {
      if (num == "bw") {
        return number(ops, num, 1000000);
      }
      if (num == "yi") {
        return number(ops, num, 100000000);
      }
      if (num == "no") {
        return numberNo(ops, num);
      }

      return ops ? ops : "--";
    }
  },
  components: {},
  computed: {},
  mounted() {},
  methods: {}
};
</script>
<style lang='scss' scoped>
</style>